#include "ThreadPoolImpl.hpp"

#include <unistd.h>





void test(int i){
    std::cout << "function:normal function void(int) , i=" << i << "threadId=" << boost::this_thread::get_id() << std::endl;
}


class testClass{
    public:
        void test(int i){
            std::cout << "function:class member function void() , i=" << i << "threadId=" << boost::this_thread::get_id() << std::endl;
        }
};

using namespace threadPool;

int main(){
    
    
    BaseThreadPool<void> * impl = ThreadPoolImpl<void>::getInstance();

    impl->setTreadPool(4);

    impl->setThreadPoolMode(BaseThreadPoolOp::ThreadPoolWorkMode::Post);

    impl->run();


    for(int i=0;i<100;i++){
        impl->addtask([i](){
            std::cout << "function:lambda void() , i=" << i << "threadId=" << boost::this_thread::get_id() << std::endl;
        });

        

        impl->addtask(
            boost::bind(&test,i)
        );

       

    }

    impl->stop();
}



